<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<%@include file="/common/common.jspf" %>
<script type="text/javascript" src="${ctx}/js/mater_receive/mater_receive_edit.js"></script>
<style type="text/css">
.col-sm-3 {
	width: 15%;
	float: left;
}

.col-sm-9 {
	width: 85%;
	float: left;
}
label[class^="btn btn-default"]{
	margin-top: -4px;
}
</style>
<script type="text/javascript" src="${ctx}/js/jedate/jedate.js"></script>
</head>
<body>
	<div class="l_err" style="width: 100%; margin-top: 2px;"></div>
	<form id="form" name="form" class="form-horizontal" method="post"
		action="${ctx}/receive/receive_editEntity.shtml">
		<input type="hidden" class="form-control checkacc" value="${before.id}"
			name="receiveformmap.id" id="id">
		<section class="panel panel-default">
			<div class="panel-body">
				<div class="form-group">
					<label class="col-sm-3 control-label">申请部门：</label>
					<div class="col-sm-9">
					<select  class="form-control" id="client" name="receiveformmap.departmentId">
							<c:forEach var="key" items="${dep}" >
								<option value="${key.id}" ${key.id==before.departmentId?'selected':'' }>${key.name }</option>	
							</c:forEach>
						</select>
					</div>
				</div>
				<div class="line line-dashed line-lg pull-in"></div>
				<div class="form-group">
					<label class="col-sm-3 control-label">物料编码：</label>
					<div class="col-sm-9">
						<input type="text" class="form-control" placeholder="请输入排产重量" required
							name="receiveformmap.materialNo"  value="${before.materialNo}">
					</div>
				</div>
				<div class="line line-dashed line-lg pull-in"></div>
				<div class="form-group">
					<label class="col-sm-3 control-label">名称：</label>
					<div class="col-sm-9">
						<input type="text" class="form-control" id="" placeholder="请输入接单日期"
							name="receiveformmap.productName"  value="${before.productName }">
					</div>
				</div>
				<div class="line line-dashed line-lg pull-in"></div>
				<div class="form-group">
					<label class="col-sm-3 control-label">型号：</label>
					<div class="col-sm-9">
						<select  class="form-control" id="client" name="receiveformmap.materials_id">
							<c:forEach var="key" items="${Model}" >
								<option value="${key.id}">${key.name }</option>	
							</c:forEach>
						</select>
					</div>
				</div>
				<div class="line line-dashed line-lg pull-in"></div>
				<div class="form-group">
					<label class="col-sm-3 control-label">单位：</label>
					<div class="col-sm-9">
					<input type="text" class="form-control" placeholder="请输入采购订单号"
							name="receiveformmap.unit"  value="${before.unit }">
					</div>
				</div>
				<div class="line line-dashed line-lg pull-in"></div>
				<div class="form-group">
					<label class="col-sm-3 control-label">领用数量：</label>
					<div class="col-sm-9">
					<input type="text" class="form-control" id="count" placeholder="请输入数量"
							name="receiveformmap.receiveCount"  value="${before.receiveCount }">
					</div>
				</div>
				<div class="line line-dashed line-lg pull-in"></div>
				<div class="form-group">
					<label class="col-sm-3 control-label">单价：</label>
					<div class="col-sm-9">
					 <input type="text" class="form-control" id="unitPrice" placeholder="请输入出货日期" 
							name="receiveformmap.unitPrice" value="${before.unitPrice}"/>
					 </div>
				</div>
				<div class="line line-dashed line-lg pull-in"></div>
				<div class="form-group">
					<label class="col-sm-3 control-label">金额：</label>
					<div class="col-sm-9">
					<input type="text" class="form-control" id="total"  placeholder="请输入定价方式"
							name="receiveformmap.total"  value="${before.total }">
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-3 control-label">用途：</label>
					<div class="col-sm-9">
					<input type="text" class="form-control" placeholder="请输入作业号"
							name="receiveformmap.purpose"  value="${before.purpose}">
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-3 control-label">损耗数：</label>
					<div class="col-sm-9">
					<input type="text" class="form-control" placeholder="请输入作业号"
							name="receiveformmap.lossNum"  value="${before.lossNum}">
					</div>
				</div>
				<div class="line line-dashed line-lg pull-in"></div>
				<div class="form-group">
					<label class="col-sm-3 control-label">日期：</label>
					<div class="col-sm-9">
						<input type="text" class="form-control" id="receiving_date" placeholder="请输入接单日期" 
							name="purchaseFromMap.tranDate"  value="${before.tranDate }">
					</div>
				</div>
				<!-- 开始处理清单 -->
			<div class="line line-dashed line-lg pull-in"></div>
			<div class="panel panel-default">
				<div class="panel-heading">
					<h3 class="panel-title">认证人员</h3>
				</div>
				<div class="panel-body">
					<table class="table table-bordered">
						<thead>
							<tr>
								<th style="text-align: center;width:176px;">申请人</th>
								<th style="text-align: center;width:176px;">业务部经理</th>
								<th style="text-align: center;width:136px;">采购员</th>
								<th style="text-align: center;width:135px;">财务部</th>
								<th style="text-align: center;width:136px;">物料仓</th>
						</thead>
						<tbody id="tbl">
								<tr>
									<%-- <td style="dispay:none">
										<div class="input-group" style="width: 100%; ">
											<input type="text" class="form-control" style=border:none; "width: 120px;"
											 name="id" id="id"
												value="${before.id}"  readonly="readonly"> <span
												class="input-group-btn">
											</span>
										</div>
									</td> --%>
									<td style="dispay:none">
										<div class="input-group" style="width: 100%; ">
											<input type="text" class="form-control"
											 name="perpor1" value="${before.perpor1}" readonly="readonly"> <span
												class="input-group-btn">
											</span>
										</div>
									</td>
									<td>
										<div class="input-group">
											<input type="text" class="form-control"
												name="perpor2" value="${before.perpor2}"
												readonly="readonly">
										</div>
									</td>
									<td>
										<div class="input-group">
											<input type="text" class="form-control"
												name="perpor3" value="${before.perpor3}"
												 readonly="readonly">
										</div>
									</td>
									<td>
										<div class="input-group">
											<input type="text" class="form-control"
												name="perpor4" value="${before.perpor4}"
												readonly="readonly">
										</div>
									</td>
									<td>
										<div class="input-group">
											<input type="text" class="form-control"
												name="perpor5" value="${before.perpor5}"
												readonly="readonly">
										</div>
									</td>
								</tr>
						</tbody>
					</table>
				</div>
			</div>

		</div>
		<footer class="panel-footer text-right bg-light lter">
		<button type="submit" class="btn btn-success btn-s-xs">提交</button>
		</footer> </section>
	</form>

<script type="text/javascript">
jeDate({
	dateCell:"#receiving_date",
	format:"YYYY-MM-DD hh:mm:ss",
	isinitVal:false,
	isTime:true, 
	isClear:false,
	minDate:"2014-09-19 00:00:00"
})
jeDate({
	dateCell:"#dateinfo",
	format:"YYYY-MM-DD hh:mm:ss",
	isinitVal:false,
	isTime:true, 
	isClear:false,
	minDate:"2014-09-19 00:00:00"
})
jeDate({
	dateCell:"#shipping_time",
	format:"YYYY-MM-DD hh:mm:ss",
	isinitVal:false,
	isTime:true, 
	isClear:false,
	minDate:"2014-09-19 00:00:00"
})
jeDate({
	dateCell:"#production_date",
	format:"YYYY-MM-DD hh:mm:ss",
	isinitVal:false,
	isTime:true, 
	isClear:false,
	minDate:"2014-09-19 00:00:00"
})
</script>
<script type="text/javascript">
//总价随着商品的数量改变而改变
$(function() {
		$("#count").change(function() {
			var unitPrice = $("#unitPrice").val();
			var count = $("#count").val();
			var total = $("#total").val();
			$("#total").val(unitPrice*count);
		});
		
		$("#unitPrice").change(function() {
			var unitPrice = $("#unitPrice").val();
			var count = $("#count").val();
			var total = $("#total").val();
			$("#total").val(unitPrice*count);
		});
		
	});
</script>
</body>
</html>